package cn.edu.sdjzu.knoverse.model.entity.kg;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Property;
import org.springframework.data.neo4j.core.schema.Relationship;
import org.springframework.data.annotation.Transient;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import java.util.Set;

@Data
@EqualsAndHashCode(callSuper = true)
@Node(primaryLabel = "Knowledge", labels = {"BaseNode"})
public class KnowledgeNode extends BaseNode {
    
    /**
     * 知识点难度等级（1-5）基础，简单，一般，困难，进阶
     */
    @Property("level")
    private Integer level;

    /**
     * 知识点标签列表
     */
    @Property("tags")
    private Set<String> tags;
    
    
    /**
     * 知识点摘要
     */
    @Property("summary")
    private String summary;
    
    /**
     * 所属课程（非持久化字段，由查询时填充）
     */
    @Transient
    private CourseNode courseNode;
    
    /**
     * 所属课程ID（非持久化字段，由查询时填充）
     */
    @Transient
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @JSONField(serializeUsing = ToStringSerializer.class)
    private Long courseId;
} 